package 静态代码块;
//由父及子，静态先行
class Root{
    static {
        System.out.println("Root静态代码块");
    }
    {
        System.out.println("Root的普通代码块");
    }
    public Root(){
        System.out.println("Root的无参数的构造器");
    }
}
class Min extends Root{
    static {System.out.println("Min的静态初始化块");}
    {System.out.println("Min的普通初始化块");}
    public Min(){System.out.println("Min的无参构造器");}
    public Min(String msg){
        //通过this调用同一类中重载的构造器
        this();
        System.out.println("Min的带参数构造器，其参数值:"+msg);
    }
}
class Leaf extends Min{
    static {
        System.out.println("leaf的静态初始化代码块");
    }
    {
        System.out.println("Leaf的普通初始化代码块");
    }
    public Leaf(){
        super("尚硅谷");//通过super调用父类中有一个字符串参数的构造器
        System.out.println("leaf的构造器");
    }
}
public class LeafTest extends Min {
    public static void main(String[] args) {
        Leaf leaf = new Leaf();
        Leaf leaf1 = new Leaf();
    }
}
